1. Field of the Invention
The present invention relates to an image interpolation device for interpolating an image.
2. Description of the Prior Art
Interpolation of an image is required, for example, when an image for interlaced scanning is converted into an image for progressive scanning, when an image is enlarged, and when the resolution of an image is increased. Such interpolation of an image is achieved, for example, by increasing the number of lines constituting the image. Specifically, according to conventionally well-know methods, between every two lines of the original image, an interpolated line is added that is produced either by using the lines of the original image immediately above or below this interpolated line intact, or by calculating the average value between the lines of the original image immediately above and below this interpolated line.
However, the former method makes the outline of a figure, such as a slanted line, that exhibits no correlation in the vertical direction appear rugged. On the other hand, the latter method degrades the resulting image by making it appear blurred. To solve these problems, a method has been proposed in which interpolation of an image is achieved by adding interpolated pixels in such a way that, out of a plurality of pairs of adjacent original pixels (note that, throughout the present specification, xe2x80x9cadjacent original pixelsxe2x80x9d denote those of the pixels of the original image which are arranged in lines adjacent to a given line of interpolated pixels) that are so located as to face each other across a given pixel to be interpolated, that pair which exhibits the highest correlation is used to produce this interpolated pixel. Note that, hereafter, a pixel or line to be interpolated will be referred to simply as an xe2x80x9cinterpolated pixel or linexe2x80x9d.
This method will be described in more detail below with reference to FIG. 11. In FIG. 11, the symbols n and n+1 represent lines of the original image, and the symbol i represents an interpolated line. To find the direction in which the highest correlation is observed among three vertical and diagonal directions H1, H2, and H3 with respect to a given interpolated pixel X, the absolute value of the difference between two adjacent original pixels is calculated in each of those directions H1, H2, and H3. Specifically, |A(0)xe2x88x92B(0)|, |A(1)xe2x88x92B(xe2x88x921)|, and |A(xe2x88x921)xe2x88x92B(1)| are calculated. Then, assuming that the highest correlation is observed in the direction in which the absolute value of the difference is smallest, the average value of the two adjacent original pixels is calculated in that direction and is determined as the value of the interpolated pixel X. For example, if the highest correlation is observed in the direction H3 among the above-mentioned three directions H1, H2, and H3, then (A(xe2x88x921)+B(1))/2 is determined as the value of the interpolated pixel X.
In an image having a fine vertical line E1 that is one pixel wide and brighter than its surroundings as shown in FIG. 12A, a part of the line E1, when enlarged, is as shown in FIG. 12B. In an image having a fine slanted line E2 that is one pixel wide and dimmer than its surroundings as shown in FIG. 13A, a part of the line E2, when enlarged, is as shown in FIG. 13B. In either case, the correlations observed in all of the three directions H1, H2, and H3 are equal, and therefore it is impossible to determine the direction in which to effect interpolation. To avoid this, the three directions H1, H2, and H3 are given different degrees of priority so that interpolation is effected in the direction given the highest priority.
Note that, throughout the present specification, xe2x80x9ceffecting interpolation in a particular directionxe2x80x9d denotes adding an interpolated pixel that is produced by using the two adjacent original pixels that face each other across the interpolated pixel in that direction.
As a result, for example, when the direction H1 is given the highest priority, interpolation is effected properly in the case shown in FIG. 12B; however, in the case shown in FIG. 13B, improper interpolation results, because interpolation is effected in the direction H1 where it should be effected in the direction H3.
That is, quite inconveniently, this interpolation method is prone to interpolation errors that occur as a result of interpolation being effected in a direction in which, although the correlation is high, no edge is found. This recognizably degrades the quality of the interpolated image, in particular in terms of the rendering of fine lines, and thus makes it impossible to obtain satisfactorily high resolution in the interpolated image. Note that the direction in which to effect interpolation may be determined by selecting one from among any number of directions greater than three as specifically described above; this, however, increases interpolation errors and thus makes the problem more serious.
An object of the present invention is to provide an image interpolation device that produces interpolated images with high resolution.
To achieve the above object, according to one aspect of the present invention, an image interpolation device is provided with: absolute difference value calculating means for calculating the absolute value of the difference between two input pixels for each of a plurality of pairs of input pixels that face each other across a to-be-interpolated pixel; edge candidate detecting means for detecting the direction in which the absolute value of the difference between the two input pixels is smallest among a plurality of directions in which the plurality of pairs of input pixels face each other across the to-be-interpolated pixel; edge candidate verifying means for checking whether or not the direction detected by the edge candidate detecting means is a direction in which an edge is found; interpolated pixel value calculating means for calculating the average value of the two input pixels that face each other across the to-be-interpolated pixel in the direction that is recognized by the edge candidate verifying means as a direction in which an edge is found; and interpolating means for determining the value calculated by the interpolated pixel value calculating means as the value of the to-be-interpolated pixel.
Specifically, the edge candidate verifying means may recognize a direction as a direction in which an edge is found if the individual differences of the two input pixels that face each other across the to-be-interpolated pixel in that direction from the input pixels lying adjacently on the identical sides of those two input pixels bear identical signs.
Alternatively, the edge candidate verifying means may recognize a direction as a direction in which an edge is found if the individual differences of the two input pixels that face each other across the to-be-interpolated pixel in that direction from the input pixels that face those two input pixels across and perpendicularly to the line on which the to-be-interpolated pixel lies bear opposite signs.
Alternatively, the edge candidate verifying means may recognize a direction as a direction in which an edge is found if the average value of the two input pixels that face each other across the to-be-interpolated pixel in that direction is nearly equal to at least one of the values of the two input pixels that face each other across the to-be-interpolated pixel and perpendicularly to the line on which the to-beinterpolated pixel lies.
Alternatively, the edge candidate verifying means may recognize a direction as a direction in which an edge is found if the absolute value of the difference between the two input pixels that face each other across the to-be-interpolated pixel and perpendicularly to the line on which the to-be-interpolated pixel lies is greater than or equal to a predetermined value.
In all of these configurations, whether or not the direction in which the highest correlation is observed (i.e. in which the absolute value of the difference between the two adjacent original pixels is smallest) is an edge direction is checked so that interpolation is effected in that direction only when this direction is recognized as an edge direction. This helps reduce interpolation errors that occur as a result of interpolation being effected in a direction in which, although the correlation is high, no edge is found, and thereby improve the quality of the interpolated image, in particular in terms of the rendering of fine lines. Thus, it is possible to obtain high-resolution images.
According to another aspect of the present invention, an image interpolation device is provided with: absolute difference value calculating means for calculating the absolute value of the difference between two input pixels for each of a plurality of pairs of input pixels that face each other across a to-be-interpolated pixel; edge direction checking means for checking, for each of a plurality of directions in which the plurality of pairs of input pixels face each other across the to-be-interpolated pixel, whether an edge is found in that direction or not; edge detecting means for detecting the direction in which an edge is found and in which the absolute value of the difference between the two input pixels is smallest among the plurality of directions in which the plurality of pairs of input pixels face each other across the to-be-interpolated pixel; interpolated pixel value calculating means for calculating the average value of the two input pixels that face each other across the to-be-interpolated pixel in the direction detected by the edge detecting means; and interpolating means for determining the value calculated by the interpolated pixel value calculating means as the value of the to-be-interpolated pixel.
Specifically, the edge direction checking means may recognize a direction as a direction in which an edge is found if the individual differences of the two input pixels that face each other across the to-be-interpolated pixel in that direction from the input pixels lying adjacently on the identical sides of those two input pixels in that direction bear identical signs.
Alternatively, the edge direction checking means may recognize a direction as a direction in which an edge is found if the individual differences of the two input pixels that face each other across the to-be-interpolated pixel in that direction from the input pixels that face those two input pixels across and perpendicularly to the line on which the to-be-interpolated pixel lies bear opposite signs.
Alternatively, the edge direction checking means may recognize a direction as a direction in which an edge is found if the average value of the two input pixels that face each other across the to-be-interpolated pixel in that direction is nearly equal to at least one of the values of the two input pixels that face each other across the to-be-interpolated pixel and perpendicularly to the line on which the to-beinterpolated pixel lies.
Alternatively, the edge direction checking means may recognize a direction as a direction in which an edge is found if the absolute value of the difference between the two input pixels that face each other across the to-be-interpolated in pixel and perpendicularly to the line on which the to-be-interpolated pixel lies is greater than or equal to a predetermined value.
In all of these configurations, interpolation is effected in the direction, among directions recognized as edge directions, in which the highest correlation is observed (i.e. in which the absolute value of the difference between the two adjacent original pixels is smallest). This helps reduce interpolation errors that occur as a result of interpolation being effected in a direction in which, although the correlation is high, no edge is found, and thereby improve the quality of the interpolated image, in particular in terms of the rendering of fine lines. Thus, it is possible to obtain high-resolution images.